package study;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author 金贵权
 * @Date 2023/6/9 17:19
 **/
public class StringConcatDemo {
    public static void main(String[] args) {
        List<User> userList = Utils.getUserList();
        List<User> collect = userList.stream().map(user -> {
            if (user.getName().equals("张三")) {
                user.setDescription(user.getName().concat("是").concat("大学生"));
            }
            return user;
        }).collect(Collectors.toList());
        System.out.println(collect);
        List<Integer> nameLength = userList.stream().map(User::getName).map(String::length).collect(Collectors.toList());
        System.out.println(nameLength);
    }
}
